<template>
	<view class="title-box">
		<image src="../../static/common/goback.png" class="goback" @tap="gobackPage" v-if="isback"></image>
		<view class="title-text">{{title}}</view>
		<view v-if="isshow" class="history" @tap="goHistory">记录</view>
	</view>
</template>

<script>
	export default{
		name:"commonTitle",
		data(){
			return{
				
			}
		},
		props:{
			title:{
				type:String
			},
			isshow:{
				type:Boolean,
				default:false
			},
			isback:{
				type:Boolean,
				default:true
			}
		},
		methods:{
			gobackPage(){
				uni.navigateBack({
					delta:1,
					animationType:'slide-out-right'
				})
			},
			goHistory(){
				this.$emit('goHistory')
			}
		}
		
	}
</script>

<style>
	.title-box{
		width: 100%;
		height: 58upx;
		display: flex;
		flex-direction: row;
		justify-content: center;
		align-items: center;
		position: relative;
	}
	.goback{
		position: absolute;
		width: 58upx;
		height: 58upx;
		left: 51upx;
		top: 0;
	}
	.title-text{
		font-size:20px;
		font-family:Alibaba PuHuiTi;
		font-weight:500;
		color:rgba(244,99,122,1);
		opacity:1;
	}
	.history{
		position: absolute;
		font-size: 16px;
		color: rgba(244,99,122,1);
		right: 51upx;
		top: 10upx;
	}
</style>
